<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改题目信息')" />
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-quesInfo-edit" th:object="${quesInfo}">
            <input name="quesId" th:field="*{quesId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">题目类型：</label>
                <div class="col-sm-8">
                    <select name="learnType" th:with="type=${@dict.getType('learn_type')}" class="form-control m-b" required>
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{learnType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">答题类型：</label>
                <div class="col-sm-8">
                    <select name="answerType" th:with="type=${@dict.getType('answer_type')}" class="form-control m-b" required>
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{answerType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">问题描述：</label>
                <div class="col-sm-8">
                    <input name="quesDesc" th:field="*{quesDesc}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">答案解析：</label>
                <div class="col-sm-8">
                    <input name="ansAnalysis" th:field="*{ansAnalysis}" class="form-control" type="text" required placeholder="多选题答案之间用&分割---格式:A&B">
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">分数：</label>
                <div class="col-sm-8">
                    <input name="quesPoints" th:field="*{quesPoints}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">选项A：</label>
                <div class="col-sm-8">
                    <input name="quesA" th:field="*{quesA}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">选项B：</label>
                <div class="col-sm-8">
                    <input name="quesB" th:field="*{quesB}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">选项C：</label>
                <div class="col-sm-8">
                    <input name="quesC" th:field="*{quesC}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">选项D：</label>
                <div class="col-sm-8">
                    <input name="quesD" th:field="*{quesD}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">选项E：</label>
                <div class="col-sm-8">
                    <input name="quesE" th:field="*{quesE}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">选项F：</label>
                <div class="col-sm-8">
                    <input name="quesF" th:field="*{quesF}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">标准答案：</label>
                <div class="col-sm-8">
                    <select class="form-control select2-multiple" multiple name="ansStandard" required id="ansStandard" >
                        <option value="">请选择正确答案项</option>
                        <option value="A" >A</option>
                        <option value="B" >B</option>
                        <option value="C" >C</option>
                        <option value="D" >D</option>
                        <option value="E" >E</option>
                        <option value="F" >F</option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "web/quesInfo";
        $("#form-quesInfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-quesInfo-edit').serialize());
            }
        }

        $(function () {
            var ansStandard = [[${quesInfo.ansStandard}]]+"";
            var ary= ansStandard.split("&");
            $("#ansStandard").val(ary).trigger("change")
        })
    </script>
</body>
</html>